<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>菜单-添加</title>

    <!-- Bootstrap -->
    <link href="/static/bootstrap-3.3.4/dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div class="main-title">
        <h3>{:isset($info['id'])?'编辑':'新增'}后台菜单</h3>
    </div>

    <div class="container">
    <form class="target-form" action="{:url('updateMenu')}">
        <div class="form-group">
            <label class="col-sm-12">
                所属菜单分组
                <span class="check-tips"></span>
            </label>
                <div class="col-sm-3">
                <select name="module" class="form-control" disabled="disabled">
                    {volist name="modules" id="mvo"}
                    <option value="{$mvo.module}" {eq name="$mvo.module" value=":input('menu_module')" }selected="selected"{/eq}>{:input('menu_module')}－{$mvo.module}－{$mvo.name}</option>
                    {/volist}
                </select>
                </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">名称<span class="check-tips">（菜单名称）</span></label>
            <div class="col-sm-6">
                <input type="text" class="form-control" name="title" value="{$info.title|default=''}" required="">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">控制器名<span class="check-tips">（Controller名称）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="controller" value="{$info.controller|default=''}" required="">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">方法名<span class="check-tips">（action 名称）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="action" value="{$info.action|default=''}" required="">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">参数<span class="check-tips">（菜单类型为外链时 参数写外链URL地址）参数格式（a=123&b=456）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="url" value="{$info.url|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">菜单类型<span class="check-tips">（内部菜单｜外链）</span></label>
            <div class="col-lg-6">
            <label class="radio-inline">
                <input type="radio" name="type" value="1">内部菜单
            </label>
            <label class="radio-inline">
                <input type="radio" name="type" value="2">外链接
            </label>
            <label class="radio-inline">
                <input type="radio" name="type" value="3">正则表达式验证参数
            </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">上级菜单<span class="check-tips">（所属的上级菜单）</span></label>
            <div class="col-lg-3">
                <select name="pid" class="form-control">
                    {volist name="menuTree" id="menu"}
                        <option value="{$menu.id}" {eq name="menu.id" value="info.pid" }selected="selected"{/eq}>{$menu.title_show}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">分组<span class="check-tips">（用于左侧分组二级菜单）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="group" value="{$info.group|default=''}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-lg-12">是否隐藏<span class="check-tips"></span>
            </label>
            <div class="col-lg-6">
            <label class="radio-inline">
                <input type="radio" name="hide" value="1">是
            </label>
            <label class="radio-inline">
                <input type="radio" name="hide" value="0">否
            </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">仅开发者模式可见<span class="check-tips"></span></label>
            <div class="col-lg-6">
                <label class="radio-inline"><input type="radio" name="is_dev" value="1">是</label>
                <label class="radio-inline"><input type="radio" name="is_dev" value="0">否</label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">排序<span class="check-tips">（用于分组显示的顺序）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="sort" value="{$info.sort|default=0}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-12">说明<span class="check-tips">（菜单详细说明）</span></label>
            <div class="col-lg-6">
                <input type="text" class="form-control" name="tip" value="{$info.tip|default=''}">
            </div>
        </div>
        <div class=" form-group col-lg-12">
            <input type="hidden" name="id" value="{$info.id|default=''}">
            <input type="hidden" name="module" value="{:input('menu_module', 'admin')}">
            <button type="submit" class="btn btn-success">确 定</button>
            <button class="btn btn-warning" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
    </div>
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="/static/form-3.51/jquery.form.js"></script>
<link rel="stylesheet" href="/static/artDialog-6.0.4/css/ui-dialog.css">
<script src="/static/artDialog-6.0.4/dist/dialog-min.js"></script>
<script src="/Admin/js/ajaxSubmit.js"></script>

<script type="text/javascript" src="/Admin/js/ThinkSetValue.js"></script>
<script type="text/javascript">
    Think.setValue("type", {$info.type|default = 1});
    Think.setValue("pid", {:input('pid', 0)});
    Think.setValue("hide", {$info.hide|default = 0});
    Think.setValue("is_dev", {$info.is_dev|default = 0});
</script>
</body>
</html>
